package com.coffee.core.enums;

/**
 * @author Xulg
 * Created in 2019-06-05 17:13
 */
public enum SmsSourceEnum {


    /**
     * C端手机号登录验证码
     */
    USER_LOGIN("user_login", "用户登录验证码"),

    /**
     * C端手机号注册验证码
     */
    USER_REGISTER("user_register", "C端手机号注册验证码"),

    /**
     * C端手机号忘记密码
     */
    USER_FORGOTPASSWORD("user_forgotPassword", "C端手机号忘记密码"),

    /**
     * 更换手机号码
     */
    CHANGE_MOBILE("change_mobile", "更换手机号码"),

    /**
     * 更换密码
     */
    CHANGE_PASSWORD("change_password", "更换手机号码"),

    /**
     * 添加手机号
     */
    ADD_MOBILE("add_mobile", "添加手机号"),

    USER_CONFIRM("user_confirm", "用户确认订单"),

    //----------------------------企业--------------------------------

    /**
     * 供应商登录验证码
     */
    BACKSTAGE_LOGIN("supplier_login", "供应商登录验证码"),

    BACKSTAGE_FORGOTPASSWORD("supplier_forgotPassword", "供应商手机号忘记密码");
    /**
     * 枚举编码
     */
    private String code;

    /**
     * 枚举描述
     */
    private String description;

    SmsSourceEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static SmsSourceEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (SmsSourceEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public String getCode() {
        return this.code;
    }

    public String getDescription() {
        return this.description;
    }
}
